<%@ page import="com.google.gson.JsonObject" %>
<%@ page import="com.chinaunicom.research.bigdatalabs.util.Tools" %>
<%@ page import="com.chinaunicom.research.bigdatalabs.util.Pair" %>
<%@ page import="java.util.Arrays" %>
<%@ page import="java.lang.reflect.Array" %>
<%@ page import="java.io.File" %>
<%--
  Created by IntelliJ IDEA.
  User: zhangxr103
  Date: 2014/10/21
  Time: 14:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>

<%
    String phone = null;
    Object number = request.getParameter("number");
    if (number != null && !number.toString().isEmpty() || request.getSession().getAttribute("number") != null) {
        if (number != null && !number.toString().isEmpty()) {
            request.getSession().setAttribute("number", number);
        }
        phone = request.getSession().getAttribute("number").toString();
    } else {
        response.sendRedirect(request.getContextPath()+"/pages/startpage.jsp");
    }

    Pair<String[],int[]> pair=Tools.LoadData("E:/WorkDir/Code/java/credit-demo/src/main/webapp/file/CB.txt_score.csv",900,50);

    String xvalue=Tools.Array2String(pair.getKey(),3,pair.getKey().length);
    String value=Tools.Array2String(pair.getValue(),3,pair.getValue().length);

%>

<html>
<head>
    <title>基本信息</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <script src="<%=request.getContextPath()%>/js/jquery/jquery-2.0.0.min.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath()%>/js/bootstrap/bootstrap.min.js" type="text/javascript"></script>
    <link href="<%=request.getContextPath()%>/css/bootstrap-combined.min.css" rel="stylesheet" media="screen">
</head>
<body>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12" >
            <img src="<%=request.getContextPath()%>/img/header.jpg" style="width: 100%;height: 25%;">
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="<%=request.getContextPath()%>/pages/privacy.jsp">基本信息</a>
                </li>
                <%--<li >--%>
                    <%--<a href="<%=request.getContextPath()%>/pages/rank.jsp">信用排名</a>--%>
                <%--</li>--%>
                <li >
                    <a href="<%=request.getContextPath()%>/pages/finance.jsp">消费走势</a>
                </li>
                <li>
                    <a href="<%=request.getContextPath()%>/pages/location.jsp">位置跟踪</a>
                </li>
                <li>
                    <a href="<%=request.getContextPath()%>/pages/socialnetwork.jsp">社交网络</a>
                </li>

                <li class="dropdown pull-right">
                    <a href="#" data-toggle="dropdown" class="dropdown-toggle"><%=phone%><strong class="caret"></strong></a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="#"></a>
                        </li>
                        <li>
                            <a href="#">设置栏目</a>
                        </li>
                        <li>
                            <a href="#">更多设置</a>
                        </li>
                        <li class="divider">
                        </li>
                        <li>
                            <a href="<%=request.getContextPath()%>/pages/startpage.jsp">退出</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <div class="row-fluid">
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                </div>
            </div>
            <div class="row-fluid text-center">
                <div class="span12">
                    <div class="row-fluid">
                        <div class="span3 text-right" style="top:50%">
                            <img alt="163x148" src="<%=request.getContextPath()%>/img/male.png" />
                        </div>
                        <div class="span3 text-center" style="top:50%">
                            <table  style="width:200px;height:150px">
                                <tbody>
                                <tr>
                                    <td>
                                        姓名
                                    </td>
                                    <td>
                                        XXX
                                    </td>
                                </tr>
                                <tr class="error">
                                    <td>
                                        年龄
                                    </td>
                                    <td>
                                        30
                                    </td>
                                </tr>
                                <tr class="warning">
                                    <td>
                                        城市
                                    </td>
                                    <td>
                                        北京
                                    </td>
                                </tr>
                                <tr class="warning">
                                    <td>
                                       套餐
                                    </td>
                                    <td>
                                        96A
                                    </td>
                                </tr>
                                <tr class="warning">
                                    <td>
                                        得分
                                    </td>
                                    <td>
                                        520
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="span6">
                            <div id="main" style="width:100%;height:400px"></div>
                            <%--<script src="/js/echarts-1.4.1/build/echarts.js"></script>--%>
                            <script src="/js/echarts-2.1.8/build/dist/echarts.js"></script>
                            <script type="text/javascript">
                                require.config({
                                    paths: {
                                        echarts: '/js/echarts-2.1.8/build/dist'
                                    }
                                });

                                // 使用
                                require(
                                        [
                                            'echarts',
                                            'echarts/chart/bar',
                                            'echarts/chart/dark',
                                        ],
                                        function (ec) {
                                            // 基于准备好的dom，初始化echarts图表
                                            var myChart = ec.init(document.getElementById('main'));
                                            myChart.setTheme('dark');
                                            var option = {
                                                title : {
                                                    text: '4G用户信用评分分布',
                                                    subtext: 'By NanBo'
                                                },
                                                tooltip : {
                                                    trigger: 'axis'
                                                },
                                                legend: {
                                                    data:['信用分数']
                                                },
                                                toolbox: {
                                                    show : true,
                                                    feature : {
                                                        mark : {show: true},
                                                        dataView : {show: true, readOnly: false},
                                                        magicType : {show: true, type: ['line', 'bar']},
                                                        restore : {show: true},
                                                        saveAsImage : {show: true}
                                                    }
                                                },
                                                calculable : true,
                                                xAxis : [
                                                    {
                                                        type : 'category',
                                                        data : [<%=Arrays.toString(pair.getKey()).replaceAll("\\[","'").replaceAll("\\]","'").replaceAll(",","','")%>]
                                                    }
                                                ],
                                                yAxis : [
                                                    {
                                                        type : 'value'
                                                    }
                                                ],
                                                series : [
                                                    {
                                                        name:'蒸发量',
                                                        type:'bar',
                                                        data:<%=value%>,
                                                        markPoint : {
                                                            data : [
                                                                {name : 'XX先生', value : <%=pair.getValue()[10]%>, xAxis: 10, yAxis: <%=pair.getValue()[10]+2%>, symbolSize:18}
//                                                                {type : 'max', name: '最大值'},
//                                                                {type : 'min', name: '最小值'}
                                                            ]
                                                        }
//                                                        markLine : {
//                                                            data : [
//                                                                {type : 'average', name: '平均值'}
//                                                            ]
//                                                        }
                                                    }
                                                ]
                                            };


                                            // 为echarts对象加载数据
                                            myChart.setOption(option);
                                        }
                                );
                            </script>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<div id="bottom" style="clear:both;bottom:0;text-align:center;vertical-align:middle;width:100%;border:0px;"><span>版权所有@中国联合网络通信有限公司研究院</span></div>
</body>
</html>
